package com.bsfcs.rag.enums;

import org.springframework.util.StringUtils;

public enum ProjectStage {
    PLANNING("0", "启动"),
    EXECUTING("1", "执行"),
    REVIEWING("2", "验收"),
    CLOSED("3", "结项"),
    DEFAULT("", "");

    private final String code;
    private final String displayName;

    ProjectStage(String code, String displayName) {
        this.code = code;
        this.displayName = displayName;
    }

    public String getCode() {
        return code;
    }

    public String getDisplayName() {
        return displayName;
    }

    public static ProjectStage fromCode(String code) {
        for (ProjectStage stage : ProjectStage.values()) {
            if (stage.getCode().equals(code)) {
                return stage;
            }
        }
        return DEFAULT;
    }
}
